function  generatespy(Nx,Ny,  m_ccc,m_css,m_cww,m_cee,m_cnn)
global L
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here

Nx3 = Nx+3;
Ny3 = Ny+3;

L = zeros(Nx3*Ny3,Nx3*Ny3);
%U = zeros(Nx3*Ny3,Nx3*Ny3);
%D = eye(Nx3*Ny3);
for ii=2:Nx+1
    for jj= 2:Ny+1
        index = (jj-1)*(Nx3) + ii;
        L(index,index) = m_ccc(jj,ii);
 %       L(index,index) = 1.0;
        L(index,index-1)= m_cww(jj,ii);
        L(index,index+1) = m_cee(jj,ii);
        L(index,index+Nx3) = m_cnn(jj,ii);
        L(index,index-Nx3) = m_css(jj,ii);
    end
end


% 
% spy(A);
% k = Nx3+2;
% l = Ny*Nx3+(Nx+1);
% B = A(k:l , k:l);
%B = A(4:(Nx+1)*(Ny+1),4:(Nx+1)*(Ny+1));
%spy(B);

end

